#/bin/bash
ip=192.168.0.30
port=8834
username=admin
password=123456
accesskey=afdad180f67fbaa98dd6dcb96339b2c208ad862796967d93d142aeb309e236c1
secretkey=f7898a4273ad2e28207e1bc81c1000de5d1d2c5dbcfdced6cc7889715db7d584
date=`date +%Y%m%d%H%M%S`



#read  -p "Scans name：" name
name=$1
scan_id=$(python3.8 nessus_report_downloader.py -i $ip -u $username -p $password | grep $name | awk '{print $1}')
echo $(python3.8 nessus_scan_result.py "$ip" "$port" "$accesskey" "$secretkey" "$scan_id")

python3.8 nessus_report_downloader.py -i $ip -u $username -p $password -s $scan_id -f 2 > /dev/null

file=$(ls -lt  | grep -m 1 html | awk {'print $9'})
mv $file ${name}_${date}.html
